<script lang="ts">
  import { type NodeProps } from "@xyflow/svelte";
  import NodeWrap from "./NodeWrap.svelte";
  import { type ExDrawNodeInfo } from "$lib/api/board/board_draw";

  const props: NodeProps = $props();

  const nodeInfo = $derived(props.data as ExDrawNodeInfo);
</script>

<NodeWrap nodeProps={props} showBorder={false} showBgColor showResizer>
  <pre
    class={`${nodeInfo.content.TextContent?.font_size ?? ""} ${nodeInfo.content.TextContent?.font_weight ?? ""} text-wrap break-all p-1 overflow-y-auto h-full nowheel`}>{nodeInfo
      .content.TextContent?.text ?? ""}</pre>
</NodeWrap>
